# Maintainer: Konstantin Gizdov <arch at kge dot pw>
pkgname=perl-locale-codes
pkgver=3.73
pkgrel=2
pkgdesc='Distribution of modules to handle locale codes'
_dist=Locale-Codes
arch=('any')
url="https://metacpan.org/release/${_dist}"
license=('GPL' 'PerlArtistic')
depends=(perl)
checkdepends=('perl-test-inter')
options=('!emptydirs' purge)
source=("https://search.cpan.org/CPAN/authors/id/SBECK/${_dist}-${pkgver}.tar.gz")
b2sums=('27bd3e3ef82629fc7ae22f9f65ba226e5dd7d735d2be716441689fd98414bc29792ee2dc3ec7f96ce73289782f4aa060996515425f99413946eeb0ec910750ff')

build() {
  cd "${srcdir}/${_dist}-${pkgver}"
  unset PERL5LIB PERL_MM_OPT PERL_LOCAL_LIB_ROOT
  export PERL_MM_USE_DEFAULT=1 PERL_AUTOINSTALL=--skipdeps
  /usr/bin/perl Makefile.PL
  make
}

check() {
  cd "${srcdir}/${_dist}-${pkgver}"
  unset PERL5LIB PERL_MM_OPT PERL_LOCAL_LIB_ROOT
  export PERL_MM_USE_DEFAULT=1
  make test
}

package() {
  cd "${srcdir}/${_dist}-${pkgver}"
  unset PERL5LIB PERL_MM_OPT PERL_LOCAL_LIB_ROOT
  make install INSTALLDIRS=vendor DESTDIR="${pkgdir}"
}
